<%@ page contentType="text/html;charset=UTF-8" %>
    <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<meta name="decorator" content="common" />
	<script type="text/javascript" src="${ctxWebStatic }/js/distpicker.min.js" ></script>
	<style type="text/css">
		em.error {
			height: 35px;
			display: inline-block;
			vertical-align: middle;
			margin-right: 2px;
			background: url("${ctxWebStatic}/images/error_img.png") no-repeat 0px
				0px;
			padding-left: 24px;
			color: #d3001e;
			font-size: 16px;
			font-family: "微软雅黑";
		}
	</style>
	<script type="text/javascript">
	var subflag = false;//标识提交状态
	var validatorUpdate;
	var validatorAddress;
	var validatorInvoiceCompany;
	var validatorInvoicePerson;
	$(function(){
		sumAccount()
		isSatisfyFree();
	    $('.shop_num').change(function(){
	    	if(!($(this).val()>0)){
	    		$(this).val(1)
	    		$('#jdTkChangeNumBox').show();
	    		isSatisfyFree();
	    		changeNum($(this).val(),$(this).attr('shoppingCartGoodsId'));
	    		return false;
	    	}
	    	if($(this).val().indexOf('.') > -1){
	    		$('#checkShowBoxSpan').text('数量需为整数');
	    		$(this).val(1)
	    		$('#checkShowBox').show();
	    		isSatisfyFree();
	    		changeNum($(this).val(),$(this).attr('shoppingCartGoodsId'));
	    		return false;
	    	}
	    	changeNum($(this).val(),$(this).attr('shoppingCartGoodsId'));
	    	isSatisfyFree()
		})
		validatorUpdate = $("#updateForm").validate({
			onfocusout: function(element) { $(element).valid(); },  
			rules : {
				company : {required : true,companyCheck : true,	rangelength:[5,30]},
				address : {required : true,addressCheck : true,	rangelength:[5,50]},
				account : {required : true,digits : true,rangelength:[5,20]},
				blank : {required : true,blankCheck : true,	rangelength:[4,30]},
				dutyCode : {required : true,dutyCodeCheck:true,	rangelength:[10,30]}
			},
			messages : {
				company : {required : '请输入企业名称',rangelength:'请输入5-30个字符，以汉字或字母开头，可带数字'},
				address : {required : '请输入开票地址',rangelength : '请输入5-50个字符，以汉字开头，可带数字、字母'},
				account : {required : '请输入账户',rangelength : '请输入5-20个数字',digits:'请输入5-20个数字'},
				blank : {required : '请输入开户银行',rangelength : '请输入4-30个字符，以汉字开头，可带数字、字母'},
				dutyCode : {required : '请输入纳税人识别号',rangelength : '请输入10-30个字母或数字'}
			},
			errorContainer: "#messageBox",
			errorPlacement: function(error, element) {
				$("#messageBox").text("输入有误，请先更正。");
				error.insertAfter(element);
			},
			errorElement : "em",
			success:function(lable){
	        	lable.remove(); 
        	},
		});
		validatorAddress = $("#addressForm").validate({
			onfocusout: function(element) { $(element).valid(); },  
			rules : {
				receive : {required : true,receiveCheck : true,	rangelength:[2,10]},
				phone : {required : true,phoneCheck : true,rangelength:[11,11]},
				address : {required : true,addressCheck : true,	rangelength:[5,50]},
				area : {required : true}
			},
			messages : {
				receive : {required : '请输入收件人',rangelength:'请输入2-10个汉字'},
				phone : {required : '请输入联系方式',rangelength : '格式错误'},
				address : {required : '请输入详细地址',rangelength : '请输入5-50个字符，以汉字开头，可带数字、字母'},
				area : {required : '请选择所在地区'}
			},
			errorContainer: "#messageBox",
			errorPlacement: function(error, element) {
				if (element.is("select")){
					error.insertAfter(element.parents('.tk_selcet'));
				} else {
					error.insertAfter(element);
				}
			},
			errorElement : "em",
			success:function(lable){
	        	lable.remove(); 
        	},
		});
		validatorInvoiceCompany = $("#InvoiceCompanyForm").validate({
			onfocusout: function(element) { $(element).valid(); },  
			rules : {
				companyName : {required : true,companyCheck : true,rangelength:[5,30]},
				companyDutyCode : {required : true,dutyCodeCheck : true,rangelength:[10,30]}
			},
			messages : {
				companyName : {required : '请输入企业名称',rangelength:'请输入5-30个字符，以汉字或字母开头，可带数字'},
				companyDutyCode : {required : '请输入纳税人识别号',rangelength : '请输入10-30个字母或数字'}
			},
			errorContainer: "#messageBox",
			errorPlacement: function(error, element) {
				error.insertAfter(element);
			},
			errorElement : "em",
			success:function(lable){
	        	lable.remove(); 
        	},
		});
		validatorInvoicePerson = $("#InvoicePersonForm").validate({
			onfocusout: function(element) { $(element).valid(); },  
			rules : {
				invoiceTitle : {required : true,receiveCheck : true,rangelength:[2,10]}
			},
			messages : {
				invoiceTitle : {required : '请输入发票抬头',rangelength : '请输入2-10个汉字'}
			},
			errorContainer: "#messageBox",
			errorPlacement: function(error, element) {
				error.insertAfter(element);
			},
			errorElement : "em",
			success:function(lable){
	        	lable.remove(); 
        	},
		});
	    jQuery.validator.addMethod("companyCheck", function(value,element, param) { 
			var tel = /^[a-zA-Z\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5]*$/;  
		 	return this.optional(element) || (tel.test(value));  
        }, $.validator.format("请输入5-30个字符，以汉字或字母开头，可带数字")); 
	    
	    jQuery.validator.addMethod("addressCheck", function(value,element, param) { 
			var tel = /^[\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5]*$/;  
		 	return this.optional(element) || (tel.test(value));  
        }, $.validator.format("请输入5-50个字符，以汉字开头，可带数字、字母")); 
	    
	    jQuery.validator.addMethod("blankCheck", function(value,element, param) { 
			var tel = /^[\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5]*$/;  
		 	return this.optional(element) || (tel.test(value));  
        }, $.validator.format("请输入4-30个字符，以汉字开头，可带数字、字母")); 
	    
	    jQuery.validator.addMethod("dutyCodeCheck", function(value,element, param) { 
			var tel = /^[a-zA-Z0-9]*$/;  
		 	return this.optional(element) || (tel.test(value));  
        }, $.validator.format("请输入10-30个字母或数字")); 
	    
	    jQuery.validator.addMethod("receiveCheck", function(value,element, param) { 
	    	var tel = /^[\u4e00-\u9fa5]*$/;  
		 	return this.optional(element) || (tel.test(value));  
        }, $.validator.format("请输入2-10个汉字")); 
	    
	    jQuery.validator.addMethod("phoneCheck", function(value,element, param) { 
	    	var tel = /^[1][3,4,5,7,8][0-9]{9}$/;  
		 	return this.optional(element) || (tel.test(value));  
        }, $.validator.format("格式错误")); 
	    
		$('.item_amout').find('.plus').click(function(){
			var index=$(this).parents('.item_amout').find('.plus').index($(this));
			if(index ==0){
				$(this).next('input').val(parseInt($(this).next('input').val())-1);
				if($(this).next('input').val()<1){
					$(this).next('input').val(1);
					$('#checkShowBoxSpan').text('商品数量应大于0');
		    		$('#checkShowBox').show();
		    		return false;
				}
				changeNum($(this).next('input').val(),$(this).next('input').attr('shoppingCartGoodsId'));
			}else{
				$(this).prev('input').val(parseInt($(this).prev('input').val())+1);
				changeNum($(this).prev('input').val(),$(this).prev('input').attr('shoppingCartGoodsId'));
			}
			isSatisfyFree()
		})
	    $('.parts_search_list').click(function(){
	    	if($(this).hasClass('wl_list')){
	    		if($(this).hasClass('isSatisfyFree')){
		    		$(this).parent().find("i").removeClass('search_chose_hover');
					$(this).find("i").addClass('search_chose_hover');
					var vv=$('.parts_search_list').index($(this));		
					$(".numRadio").find('input').eq(vv).click();
					$('#satisfyFreeShow').show();
	    		}
	    	}else{
	    		$(this).parent().find("i").removeClass('search_chose_hover');
				$(this).find("i").addClass('search_chose_hover');
				var vv=$('.parts_search_list').index($(this));		
				$(".numRadio").find('input').eq(vv).click();
	    		$('#satisfyFreeShow').hide();
	    	}
	     });
		//点击需要发票标题文字展开发票设置框
	     $("#payDetailInvoice").click(function(){
			if ($(this).parent().find("i").hasClass("search_chose_hover")) {
				$(this).parent().find("i").removeClass("search_chose_hover");
				$(this).parents(".shopping_car_list").find(".fp_titket_box").hide()
			} else{
				$(this).parent().find("i").addClass("search_chose_hover");
				$(this).parents(".shopping_car_list").find(".fp_titket_box").show()
			}
			var Inputindex=$('.parts_search_list').index($(this));
			$(".numRadio").find('input').eq(Inputindex).click();
		});
		//发票抬头设置
		$(".fp_tab_chose a").click(function(){
			validatorInvoiceCompany.resetForm();
			validatorInvoicePerson.resetForm();
			$(".fp_tab_chose a").removeClass('on_bor');
			$(this).addClass("on_bor");
			showIndex=$(this).index();
			$(this).parents('.fp_tab_box').find(".fp_tab_item").hide();
			$(this).parents('.fp_tab_box').find(".fp_tab_item").eq(showIndex).show();
		});
		//设为默认
		$(".default_box").click(function(){
			if ($(this).parent().find("i").hasClass("search_chose_hover")) {
				$(this).parent().find("i").removeClass("search_chose_hover");
			} else{
				$(this).parent().find("i").addClass("search_chose_hover");
			}
			var Inputindex=$('.parts_search_list').index($(this));
			$(".numRadio").find('input').eq(Inputindex).click();
		});
		//弹框
		$(".new_address").click(function(){
			$("#proment_new").show();	
		});
		//选择收货地址后保存
		$("#proment_chose_address .shopping_car_confirm a").click(function(){
			$("#proment_new_address").hide();
			$("#proment_chose_address").hide();
			var chose_box = $('#proment_chose_address').find('.chose_set_box').find('.chose_address_info_hover');
			var chose_address_id = $(chose_box).find('.chose_address_info_id').text();
			var chose_address_province = $(chose_box).find('.chose_address_info_province').text();
			var chose_address_receive = $(chose_box).find('.chose_address_info_receive').text();
			var chose_address_phone = $(chose_box).find('.chose_address_info_phone').text();
			var chose_address_address = $(chose_box).find('.chose_address_info_address').text();
			if(chose_address_id!=''){
				refreshAddress(chose_address_id,chose_address_province,chose_address_receive,chose_address_phone,chose_address_address);
			}
		});
		//选择发票邮寄地址后保存
		$("#proment_chose_invoice_address .shopping_car_confirm a").click(function(){
			$("#proment_new_address").hide();
			$("#proment_chose_address").hide();
			$("#proment_chose_invoice_address").hide();
			var chose_box = $('#proment_chose_invoice_address').find('.chose_set_box').find('.chose_address_info_hover');
			var chose_address_id = $(chose_box).find('.chose_address_info_id').text();
			var chose_address_receive = $(chose_box).find('.chose_address_info_receive').text();
			var chose_address_phone = $(chose_box).find('.chose_address_info_phone').text();
			var chose_address_address = $(chose_box).find('.chose_address_info_address').text();
			refreshInvoiceAddress(chose_address_id,chose_address_receive,chose_address_phone,chose_address_address);
		});
		//选择开票信息后保存
		$("#proment_chose_invoice .shopping_car_confirm a").click(function(){
			$("#proment_chose_invoice").hide();
			var chose_box = $('#proment_chose_invoice').find('.chose_set_box').find('.chose_address_info_hover');
			var chose_invoice_id = $(chose_box).find('.chose_invoice_id').text();
			var chose_invoice_company = $(chose_box).find('.chose_invoice_company').text();
			var chose_invoice_account = $(chose_box).find('.chose_invoice_account').text();
			var chose_invoice_blank = $(chose_box).find('.chose_invoice_blank').text();
			var chose_invoice_address = $(chose_box).find('.chose_invoice_address').text();
			var chose_invoice_dutyCode = $(chose_box).find('.chose_invoice_dutyCode').text();
			var chose_invoice_isDef = $(chose_box).find('.chose_invoice_isDef').text();
			refreshInvoice(chose_invoice_id,chose_invoice_company,chose_invoice_address,chose_invoice_account,chose_invoice_blank,chose_invoice_dutyCode,chose_invoice_isDef)
		});
		$('.close_page').click(function (){
			$(this).parents('.jd_tk').hide();
		})
		//打开新增地址框
		$(".js_new_address").click(function(){
			validatorAddress.resetForm();  
			var flag = true;
			$.ajax({
				url:'${ctxWeb}/address/selectByUserId',
				async:false,
				success:function(result){
					if(result!=null){
						if(!(result.length<10)){
							$('#checkShowBoxSpan').text('最多只能添加10个地址，不能继续添加新地址');
							$('#checkShowBox').show();
							flag = false;
						}
					}
				}
			})
			if(!flag){
				return;
			}
			$('.receiveName').val('');
			$('.receivePhone').val('')
			$('.provinceSelect').val('')
			$('.citySelect').val('')
			$('.areaSelect').val('')
			$('.receiveAddress').val('')
			$('.default_box').find('.search_chose').removeClass('search_chose_hover')
			$.ajax({
				url:'${ctxWeb}/address/getProvince',
				async:false,
				success:function(result){
					var html = '<option value="">省</option>';
					if(result!=null){
						for(var i = 0;i<result.length;i++){
							var area = result[i];
							if(area.name.length>4){
								var content = area.name.substring(0,3)+'...';
							}else{
								var content = area.name.substring(0,3);
							}
							html += '<option value="'+area.id+'" title="'+area.name+'">'+content+'</option>'
						}
					}
					$('.provinceSelect').html(html)
				}
			})
			$("#proment_new_address").show();	
		});
		//省份下拉框选择事件
		$('.provinceSelect').change(function(){
			var provinceId = $(this).val();
			$.ajax({
				url:'${ctxWeb}/address/selectByParent',
				async:false,
				data:{'id':provinceId},
				success:function(result){
					var html = '<option value="">市</option>';
					if(result!=null){
						for(var i = 0;i<result.length;i++){
							var area = result[i];
							if(area.name.length>4){
								var content = area.name.substring(0,3)+'...';
							}else{
								var content = area.name.substring(0,3);
							}
							html += '<option value="'+area.id+'" title="'+area.name+'">'+content+'</option>'
						}
					}
					$('.citySelect').html(html)
					$('.areaSelect').html('<option value="">区</option>')
				}
			})
		})
		//市级下拉框选择事件
		$('.citySelect').change(function(){
			var cityId = $(this).val();
			$.ajax({
				url:'${ctxWeb}/address/selectByParent',
				async:false,
				data:{'id':cityId},
				success:function(result){
					var html = '<option value="">区</option>';
					if(result!=null){
						for(var i = 0;i<result.length;i++){
							var area = result[i];
							if(area.name.length>4){
								var content = area.name.substring(0,3)+'...';
							}else{
								var content = area.name.substring(0,3);
							}
							html += '<option value="'+area.id+'" title="'+area.name+'">'+content+'</option>'
						}
					}
					$('.areaSelect').html(html)
				}
			})
		})
		//新增收貨地址地址保存
		$(".proment_chose_address_save a").click(function(){
			var id = $('.receiveId').val()
			var receive = $('.receiveName').val()
			var phone = $('.receivePhone').val()
			var province = $('.provinceSelect').val()
			var provinceName = $('.provinceSelect').find("option:selected").attr('title');
			var city = $('.citySelect').val()
			var cityName = $('.citySelect').find("option:selected").attr('title');
			var area = $('.areaSelect').val()
			var areaName = $('.areaSelect').find("option:selected").attr('title');
			var address = $('.receiveAddress').val()
			var isDef = 0;
			if($('.address_Bomb_info').find('.default_box').find('.search_chose').hasClass('search_chose_hover')){
				isDef = 1;
			}
			var checkFlag = true;
			if (!$("#addressForm").valid()) {
				checkFlag = false;
			}
			if (!checkFlag) {
				return false;
			}
			$.ajax({
				url:'${ctxWeb}/address/saveAddress',
				async:false,
				data:{
					'id':id,
					'receive':receive,
					'phone':phone,
					'province':province,
					'provinceName':provinceName,
					'city':city,
					'cityName':cityName,
					'area':area,
					'areaName':areaName,
					'address':address,
					'isDef':isDef
				},
				success:function(result){
					refreshAddress(result.id,result.province,result.receive,result.phone,result.provinceName+result.cityName+result.areaName+result.address);
					$('#proment_new_address').hide();
				}
			})
		});
		//弹出选择收货地址框
		$(".js_chose_address").click(function(){
			var html = selectAddressByUserId();
			$("#proment_chose_address").find('.chose_set_box').html(html);
			$("#proment_chose_address").show();	
		});
		//弹出选择发票邮寄地址框
		$("#chose_invoice_address").click(function(){
			var html = selectAddressByUserId();
			$("#proment_chose_invoice_address").find('.chose_set_box').html(html);
			$("#proment_chose_invoice_address").show();	
		});
		$(".chose_set_box").on('click','.chose_address_info',function(){
			$(this).parent().find(".chose_address_info").removeClass("chose_address_info_hover");
			$(this).addClass("chose_address_info_hover");	
		});
		//选择配送信息
		$('input[name="transportTypeRaDio"]').click(function(){
			var transportType = $(this).val();
			var shopping_info_box = $(".shopping_info_box p").parents('.shopping_info_box');
			if(transportType==1){
				$(shopping_info_box).find('.yf_wl').removeClass('hide');
				$(shopping_info_box).find('.yf_kd').addClass('hide');
			}else{
				$(shopping_info_box).find('.yf_wl').addClass('hide');
				$(shopping_info_box).find('.yf_kd').removeClass('hide');
			}
			$('#transportType').val(transportType);
			sumAccount();
		})
		//选择发票类型
		$('#invoiceTypeSelect').change(function(){
			var invoiceType = $('#invoiceTypeSelect').val();
			if("1"==invoiceType){//选择专用
				//获取默认
				$.ajax({
					url:'${ctxWeb}/webInvoice/getDefInvoice',
					async:false,
					success:function(result){
						if(result!=null){
							refreshInvoice(result.id,result.company,result.address,result.account,result.blank,result.dutyCode,result.isDef);
						}
					}
				})
				$('#commonInvoive').hide();
				$('#specialInvoive').show();
			}else{//选择普通
				$('#commonInvoive').show();
				$('#specialInvoive').hide();
			}
			
		})
	
	})
	//弹出选择开票信息框
	function choseInvoice(){
		var html = selectInvoiceByUserId();
		$("#proment_chose_invoice").find('.chose_set_box').html(html);
		$("#proment_chose_invoice").show();	
	}
	//弹出新增窗口
	function showAdd() {
		var invoiceSize = 0;
		$.ajax({
			url:'${ctxWeb}/webInvoice/selectByUserId',
			async:false,
			success:function(result){
				invoiceSize = result.length;
			}
		})
		if(!(invoiceSize<10)){
			$('#checkShowBoxSpan').text('最多只能添加10个发票信息，不能继续添加新发票信息');
			$('#checkShowBox').show();
			return;
		}
		validatorUpdate.resetForm();
		Modify = false;//标识为非修改状态
		invoiceId = "";
		$("#invoiceId").val("");
		$("#company").val("");
		$("#address").val("");
		$("#account").val("");
		$("#blank").val("");
		$("#dutyCode").val("");
		if ($("#proment_new_fptitket").find("i").hasClass("search_chose_hover")) {
			$("#proment_new_fptitket").find("i").removeClass(
					"search_chose_hover");
		}
		$("#isDef").prop("checked", false);
		$("#proment_new_fptitket").show();
	}
	//弹出修改窗口
	function showModify() {
		validatorUpdate.resetForm();
		invoiceId = $('.special_invoice_id').text();
		company = $('.special_invoice_company').text();
		address = $('.special_invoice_address').text();
		account = $('.special_invoice_account').text();
		blank = $('.special_invoice_blank').text();
		dutyCode = $('.special_invoice_code').text();
		isDef = $('.special_invoice_isDef').text();
		if(invoiceId==''){
			$('#checkShowBoxSpan').text('请先选择开票信息');
			$('#checkShowBox').show();
			return false;
		}
		$("#invoiceId").val(invoiceId);
		$("#company").val(company);
		$("#address").val(address);
		$("#account").val(account);
		$("#blank").val(blank);
		$("#dutyCode").val(dutyCode);
		if (isDef == 1) {
			if ($("#proment_new_fptitket").find("i").hasClass("search_chose_hover")) {
			} else {
				$("#proment_new_fptitket").find("i").addClass("search_chose_hover");
			}
			Modify = true;
			$("#isDef").prop("checked", true);

		} else {
			if ($(".default_box").parent().find("i").hasClass("search_chose_hover")) {
				$(".default_box").parent().find("i").removeClass("search_chose_hover");
			}
			Modify = false;
			$("#isDef").prop("checked", false);
		}
		$("#proment_new_fptitket").show();
	}
	//新增
	function sub() {
		var checkFlag = true;
		if (!$("#updateForm").valid()) {
			checkFlag = false;
		}
		if (!checkFlag) {
			return false;
		}
		$.ajax({
			url:"${ctxWeb}/webInvoice/saveReturn",
			data:$("#updateForm").serialize() ,
			async:false,
			success:function(result){
				if(result!=null){
					refreshInvoice(result.id,result.company,result.address,result.account,result.blank,result.dutyCode,result.isDef);
				}
				$('#proment_new_fptitket').hide();
			}
		});
	}
	function sumAccount(){
		var sum_accont=0
		$('.shop_num').each(function(k,v){
			if($(v).parents('.shopping_car_item_a').find('.shop_num').length>0){
				var price=parseFloat($(v).parents('.shopping_car_item_a').find('.price_value').text());
				var num=parseInt($(v).parents('.shopping_car_item_a').find('.shop_num').val());
				sum_price=price*num;
				sum_accont+=sum_price
				sum_price=sum_price.toFixed(2);
				$(v).parents('.shopping_car_item_a').find('.sum_price').text(sum_price);
			}
		})
		var sum_yf_p = $(".shopping_info_box p").parents('.shopping_info_box').find('.yf_wl').find('.sum_yf');
		$(sum_yf_p).text((sum_accont*0.10).toFixed(2))
		var sum_yf=parseFloat($(sum_yf_p).text());
		if(!$(sum_yf_p).parents('.yf_wl').hasClass('hide')){
			if(!$(sum_yf_p).parents('.yf_wl').hasClass('isSatisfyFree')){
				sum_accont_total=sum_accont+sum_yf;
			}else{
				$(sum_yf_p).text('0.00');
				sum_accont_total = sum_accont;
			}
		}else{
			sum_accont_total = sum_accont;
		}
		sum_accont=sum_accont.toFixed(2);
		sum_accont_total=sum_accont_total.toFixed(2);
		$('.sum_accont').text(sum_accont);
		$('.sum_accont_all').text(sum_accont_total)
	}
	function changeNum(goods_num,goods_id){
		$.ajax({
			url:"${ctxWeb}/shoppingCart/changeNum",
			data:{'goodsNum':goods_num,'id':goods_id},
			async:false
		});
	}
	//检查是否满足包邮
	function isSatisfyFree(){
		sumAccount();
		var sendAreaId = $('#sendAreaId').val();
		var receiveAreaId = $('#receiveAreaId').val();
		$('#sendAreaIdInput').val(sendAreaId);
		$('#receiveAreaIdInput').val(receiveAreaId);
		var money = $('.sum_accont_all').text();
		if(receiveAreaId!=''){
			$.ajax({
				url:'${ctxWeb}/freeWaybill/isSatisfyFree',
				data:{'sendAreaId':sendAreaId,'provinceId':receiveAreaId},
				async:false,
				success:function(result){
					if(result!=null && result!=''){
						var satisfyMoney = result.money;
						if(satisfyMoney>money){//不满足包邮条件
							$('.yf_wl').removeClass('isSatisfyFree');
							$('.wl_list').find('.search_chose').removeClass('search_chose_hover');
							$('.advance').removeClass('hide');
							$('.kd_list').find('.search_chose').addClass('search_chose_hover');
							$('.wl_list').removeClass('isSatisfyFree')
							$('.wl_list').find('.color_red').text('未满足包邮门槛，不能选择该运输方式')
							var shopping_info_box = $(".shopping_info_box p").parents('.shopping_info_box');
							$(shopping_info_box).find('.yf_wl').addClass('hide');
							$(shopping_info_box).find('.yf_kd').removeClass('hide');
							$('#transportType').val('2');
							$('#isSatisfyFreeInput').val("0")
						}else{
							$('.yf_wl').find('.sum_yf').text('0.00');
							$('.yf_wl').addClass('isSatisfyFree');
							$('.advance').addClass('hide');
							$('.wl_list').addClass('isSatisfyFree');
							$('.wl_list').find('.color_red').text('满足包邮条件')
							var shopping_info_box = $(".shopping_info_box p").parents('.shopping_info_box');
							$(shopping_info_box).find('.yf_kd').addClass('hide');
							$(shopping_info_box).find('.yf_wl').removeClass('hide');
							$('.wl_list').find('.search_chose').addClass('search_chose_hover');
							$('.kd_list').find('.search_chose').removeClass('search_chose_hover');
							$('#isSatisfyFreeInput').val("1")
						}
						$('#satisfyFreeMoney').text(satisfyMoney);
						$('#satisfyFreeShow').show();
					}else{
						$('#satisfyFreeShow').hide();
					}
				}
			})
		}else{
			$('#satisfyFreeShow').hide();
			var shopping_info_box = $(".shopping_info_box p").parents('.shopping_info_box');
			$(shopping_info_box).find('.yf_wl').addClass('hide');
			$(shopping_info_box).find('.yf_kd').removeClass('hide');
		}
		sumAccount();
	}
	//获取当前用户的所有有效地址
	function selectAddressByUserId(){
		var html = '';
		 $.ajax({
			url:'${ctxWeb}/address/selectByUserId',
			async:false,
			success:function(result){
				if(result!=null){
					for(var i = 0;i<result.length;i++){
						var address = result[i];
						if(address.isDef==0){
							html += '<div class="chose_address_info address_Bomb_info clearfix">';
						}else{
							html += '<div class="chose_address_info address_Bomb_info chose_address_info_hover clearfix">';
						}
						html += '<figure class="Settlement_address_msg">';
						html += '<p class="chose_address_info_id hide">'+address.id +'</p>';
						html += '<p class="chose_address_info_province hide">'+address.province +'</p>';
						html += '<p><em>收件人&nbsp;&nbsp;&nbsp;&nbsp;：</em><span class="chose_address_info_receive">'+address.receive +'</span></p>';
						html += '<p><em>联系方式  ：</em><span class="chose_address_info_phone">'+address.phone +'</span></p>';
						html += '<p><em>收货地址  ：</em><span class="chose_address_info_address">'+address.provinceName+address.cityName+address.areaName+address.address+'</span></p>';
						html += '<p class="set_address">当前默认</p></figure></div>';
					}
				}
			}
		})
		return html;
	}
	//获取当前用户的所有开票信息
	function selectInvoiceByUserId(){
		var html = '';
		 $.ajax({
			url:'${ctxWeb}/webInvoice/selectByUserId',
			async:false,
			success:function(result){
				if(result!=null){
					for(var i = 0;i<result.length;i++){
						var invoice = result[i];
						if(invoice.isDef==0){
							html += '<div class="chose_address_info address_Bomb_info clearfix">';
						}else{
							html += '<div class="chose_address_info address_Bomb_info chose_address_info_hover clearfix">';
						}
						html += '<figure class="Settlement_address_msg">';
						html += '<p class="chose_invoice_id hide">'+invoice.id +'</p>';
						html += '<p><em>企业名称&nbsp;&nbsp;&nbsp;&nbsp;：</em><span class="chose_invoice_company">'+invoice.company +'</span></p>';
						html += '<p><em>开票地址  ：</em><span class="chose_invoice_address">'+invoice.address+'</span></p>';
						html += '<p><em>账号  ：</em><span class="chose_invoice_account">'+invoice.account +'</span></p>';
						html += '<p><em>开户行  ：</em><span class="chose_invoice_blank">'+invoice.blank +'</span></p>';
						html += '<p><em>纳税人识别号  ：</em><span class="chose_invoice_dutyCode">'+invoice.dutyCode +'</span></p>';
						html += '<span class="chose_invoice_isDef hide">'+invoice.isDef +'</span>';
						html += '<p class="set_address">当前默认</p></figure></div>';
					}
				}
			}
		})
		return html;
	}
	//修改地址
	function editAddress(){
		$.ajax({
			url:'${ctxWeb}/address/getProvince',
			async:false,
			success:function(result){
				var html = '<option value="">省</option>';
				if(result!=null){
					for(var i = 0;i<result.length;i++){
						var area = result[i];
						if(area.name.length>4){
							var content = area.name.substring(0,3)+'...';
						}else{
							var content = area.name.substring(0,3);
						}
						html += '<option value="'+area.id+'" title="'+area.name+'">'+content+'</option>'
					}
				}
				$('.provinceSelect').html(html)
			}
		})
		var addressId = $('#choseAddressId').val();
		if(addressId!=null && addressId!=''){
			$.ajax({
				url:'${ctxWeb}/address/getAddress',
				data:{'id':addressId},
				async:false,
				success:function(result){
					$('.receiveId').val(result.id)
					$('.receiveName').val(result.receive)
					$('.receivePhone').val(result.phone)
					$('.receiveAddress').val(result.address)
					$(".provinceSelect").find("option[value='"+result.province+"']").attr("selected",true);
					$(".provinceSelect").change()
					$(".citySelect").find("option[value='"+result.city+"']").attr("selected",true);
					$(".citySelect").change()
					$(".areaSelect").find("option[value='"+result.area+"']").attr("selected",true);
					if(result.isDef=='1'){
						$('.default_box').find('.search_chose').addClass('search_chose_hover');
					}else{
						$('.default_box').find('.search_chose').removeClass('search_chose_hover');
					}
					$("#proment_new_address").show();	
				}
			})
		}
	}
	//刷新当前选择地址
	function refreshAddress(chose_address_id,chose_address_province,chose_address_receive,chose_address_phone,chose_address_address){
		var Settlement_address = $('.Settlement_address');
		var Settlement_address_left = $('.Settlement_address_left');
		$('#choseAddressId').val(chose_address_id);
		$('#receiveAreaId').val(chose_address_province);
		$(Settlement_address).find('.settlement_address_receive').text(chose_address_receive);
		$(Settlement_address).find('.settlement_address_phone').text(chose_address_phone);
		$(Settlement_address).find('.settlement_address_address').text(chose_address_address);
		var html = '';
		html += '<figure class="col-xs-3 pad0 Settlement_address_right">'
		html += '<a href="javascript:void(0)" class="js_edit_address" style="padding-top: 20px;" onclick="editAddress()">修改地址</a>';
		html += '</figure>'
		if(($(Settlement_address_left).find('figure').size())<3){
			$(Settlement_address_left).append(html);
		}
		isSatisfyFree();
	}
	//刷新当前选择发票邮寄地址
	function refreshInvoiceAddress(chose_address_id,chose_address_receive,chose_address_phone,chose_address_address){
		var Settlement_address = $('.fp_address_msg');
		$(Settlement_address).find('.settlement_address_id').text(chose_address_id);
		$(Settlement_address).find('.invoice_receive_name').text(chose_address_receive);
		$(Settlement_address).find('.invoice_receive_phone').text(chose_address_phone);
		$(Settlement_address).find('.invoice_receive_address').text(chose_address_address);
	}
	//刷新当前默认开票
	function refreshInvoice(special_invoice_id,special_invoice_company,special_invoice_address,special_invoice_account,special_invoice_blank,special_invoice_code,special_invoice_isDef){
		var special_invoice = $('.special_invoice');
		$(special_invoice).find('.special_invoice_id').text(special_invoice_id);
		$(special_invoice).find('.special_invoice_company').text(special_invoice_company);
		$(special_invoice).find('.special_invoice_address').text(special_invoice_address);
		$(special_invoice).find('.special_invoice_account').text(special_invoice_account);
		$(special_invoice).find('.special_invoice_blank').text(special_invoice_blank);
		$(special_invoice).find('.special_invoice_code').text(special_invoice_code);
		$(special_invoice).find('.special_invoice_isDef').text(special_invoice_isDef);
	}
	//提交订单
	function confirmOrder(){
		//获取订单内涉及到购物车
		var shoppingCartIds = '';
		$('.order_shopping_cart_id').each(function(k,v){
			shoppingCartIds += $(v).text()+',';
		})
		if(shoppingCartIds!=''){
			shoppingCartIds=shoppingCartIds.substring(0,shoppingCartIds.length-1);
			$('#shoppingCartIds').val(shoppingCartIds)
		}
		//获取地址信息
		var Settlement_address = $('.Settlement_address');
		var addressId = $('#choseAddressId').val();
		if(addressId==''){
			$('#checkShowBoxSpan').text('请选择收货地址');
	   		$('#checkShowBox').show();
	   		return false;
		}
		$('#receiveName').val($(Settlement_address).find('.settlement_address_receive').text())
		$('#receivePhone').val($(Settlement_address).find('.settlement_address_phone').text())
		$('#receiveAddress').val($(Settlement_address).find('.settlement_address_address').text())
		//勾选了需要发票
		if($('#payDetailInvoice').find('.search_chose').hasClass('search_chose_hover')){
			$('#isInvoice').val("1");
			var invoiceType = $('#invoiceTypeSelect').val();
			$('#invoiceTypeInput').val(invoiceType);
			var invoice_address_id = $('.settlement_address_id').text();
			if(invoice_address_id==''){
				$('#checkShowBoxSpan').text('请选择发票邮寄地址');
		   		$('#checkShowBox').show();
		   		return false;
			}
			$('#invoiceReceiveName').val($('.invoice_receive_name').text());
			$('#invoiceReceivePhone').val($('.invoice_receive_phone').text());
			$('#invoiceReceiveAddress').val($('.invoice_receive_address').text());
			
			if(invoiceType=="1"){//增值税专用发票
				if($('.special_invoice_id').text()==''){
					$('#checkShowBoxSpan').text('请选择开票信息');
			   		$('#checkShowBox').show();
			   		return false;
				}
				$('#invoice_company').val($('.special_invoice_company').text());
				$('#invoice_address').val($('.special_invoice_address').text());
				$('#invoice_account').val($('.special_invoice_account').text());
				$('#invoice_blank').val($('.special_invoice_blank').text());
				$('#invoice_dutyCode').val($('.special_invoice_code').text());
				$('#invoiceTitleInput').val($('.special_invoice_company').text());
				$('#commonConfirmOrderForm').submit();
			}else{//增值税普通发票
				var type = $('#commonInvoive').find('.on_bor').attr('type');
				if(type=="1"){//单位
					$('#invoice_company').val($('#companyName').val());
					$('#invoice_dutyCode').val($('#companyDutyCode').val());
					$('#invoiceTitleInput').val($('#companyName').val());
					if($("#InvoiceCompanyForm").valid()){
						$('#commonConfirmOrderForm').submit();
					}else{
						$('#checkShowBoxSpan').text('请输入开票信息');
				   		$('#checkShowBox').show();
				   		return false;
					}
				}else{
					var title = $('#invoiceTitle').val();
					$('#invoiceTitleInput').val(title);
					if($("#InvoicePersonForm").valid()){
						$('#commonConfirmOrderForm').submit();
					}else{
						$('#checkShowBoxSpan').text('请输入开票信息');
				   		$('#checkShowBox').show();
				   		return false;
					}
				}
			}
		}else{
			$('#commonConfirmOrderForm').submit();
		}
	}
    </script>
</head>
	<body>
	<!--购物车-->
	<div class=" shopping_car_box">
		<div class="container">
			<div class="row">
				<div class="pay_detail_box">
					<!--地址信息-->
					<div class="shopping_car_list">
						<h3 class="pay_detail_tit">地址信息</h3>
						<div class="Settlement_address clearfix">
							<div class="col-xs-9 Settlement_address_left pad0 clearfix">
								<figure class="col-xs-2 col-sm-1 pad0 text-center">
									<img src="${ctxWebStatic }/images/gps_address.png" alt="" />
									<p class="font-sm12">默认</p>
								</figure>
								<figure class="Settlement_address_msg col-xs-8">
								<c:if test="${empty defAddress}">
									<input type="hidden" value="${defAddress.province }" id="receiveAreaId">
									<input type="hidden" value="${defAddress.id }" id="choseAddressId">
									<p><em>收件人&nbsp;&nbsp;&nbsp;&nbsp;：</em><span class="settlement_address_receive">&nbsp;</span></p>
									<p><em>联系方式  ：</em><span class="settlement_address_phone">&nbsp;</span></p>
									<p><em>收货地址  ：</em><span class="settlement_address_address">&nbsp;</span></p>
								</c:if>
								<c:if test="${not empty defAddress}">
									<input type="hidden" value="${defAddress.province }" id="receiveAreaId">
									<input type="hidden" value="${defAddress.id }" id="choseAddressId">
									<p class="settlement_address_province hide">${defAddress.province }</p>
									<p><em>收件人&nbsp;&nbsp;&nbsp;&nbsp;：</em><span class="settlement_address_receive">${defAddress.receive }</span></p>
									<p><em>联系方式  ：</em><span class="settlement_address_phone">${defAddress.phone }</span></p>
									<p><em>收货地址  ：</em><span class="settlement_address_address">${defAddress.provinceName }${defAddress.cityName }${defAddress.areaName }${defAddress.address }</span></p>
								</c:if>
								</figure>
								<c:if test="${not empty defAddress}">
									<figure class="col-xs-3 pad0 Settlement_address_right">
										<a href="javascript:void(0)" class="js_edit_address" style="padding-top: 20px;" onclick="editAddress()">修改地址</a>
									</figure>
								</c:if>
							</div>
							<div class="col-xs-3 Settlement_address_right pad0">
								<a href="javascript:void(0)" class="js_chose_address">选择地址</a>
								<a href="javascript:void(0)" class="js_new_address">新增地址</a>
							</div>
						</div>
					</div>
					<!--地址信息结束-->
					<!--配送信息-->
					<div class="shopping_car_list">
						<h3 class="pay_detail_tit">配送信息</h3>
						<div class="dc_info_box clearfix">
							<p class="parts_search_list kd_list col-sm-offset-1" id="kd_list">
								<i class="search_chose search_chose_hover"></i>
								<span>快递（到付）</span>
							</p>
							<p class="parts_search_list wl_list">
								<i class="search_chose"></i>
								<span>物流&nbsp;&nbsp;<em class="color_red"></em></span>
							</p>
							<p id="satisfyFreeShow">
								<span>满<em id="satisfyFreeMoney"></em>包邮</span>
							</p>
							<div class='numRadio' style="display: none;">
								<input type='radio' name='transportTypeRaDio' value='2' />
								<input type='radio' name='transportTypeRaDio' checked="checked" value='1'/>
							</div>
						</div>
					</div>
					<!--配送信息结束-->
					<!--发票信息-->
					<div class="shopping_car_list">
						<h3 class="pay_detail_tit fp_mar" id="payDetailInvoice">
							<i class="search_chose"></i>
							需要发票
						</h3>
						<div class='numRadio' style="display: none;">
							<input type='checkbox' name='needInvoice' value='1' />
						</div>
						<div class="fp_titket_box col-sm-offset-1" style="display: none;">
							<div class="form-group clearfix">
							    <label  class="col-sm-2 col-xs-5 fp_lable control-label ">
							    	发票类型：
							    </label>
							    <div class="col-sm-5 col-xs-7 fp_input_left pad0">
							      	<select class="form-control hy" id="invoiceTypeSelect">
								      <option value="2" selected="selected">增值税普通发票</option>
								      <option value="1">增值税专用发票</option>
								    </select>
							    </div>
							</div>
							<!--发票切换-->
							<!-- 增值税普通发票  -->
							<div class="fp_tab_box" id="commonInvoive">
								<div class="form-group clearfix">
								    <label  class="col-sm-2 col-xs-5 fp_lable control-label ">
								    	发票抬头：
								    </label>
								    <div class="col-sm-5 col-xs-7 fp_tab_chose pad0">
								      	<a href="javascript:void(0)" class="on_bor" type="1">单位</a>
								      	<a href="javascript:void(0)" type="2">个人</a>
								    </div>
								</div>
								<div class="fp_tab_yab">
									<!--单位信息-->
									<form action="" id="InvoiceCompanyForm" method="post">
									<div class="fp_tab_item">
										<div class="form-group clearfix">
											<label  class="col-sm-2 col-xs-5 fp_lable control-label ">
										    	企业名称：
										    </label>
										    <div class="col-sm-5 col-xs-7  pad0">
										      	<input type="text" id="companyName" name="companyName" class="form-control" placeholder="请输入营业执照上企业名称">
										    </div>
										</div>
										<div class="form-group clearfix">
											<label  class="col-sm-2 col-xs-5 fp_lable control-label ">
										    	纳税人识别号：
										    </label>
										    <div class="col-sm-5 col-xs-7 pad0">
										      	<input type="text" id="companyDutyCode" name="companyDutyCode" class="form-control" placeholder="请输入纳税人识别号">
										    </div>
										</div>
									</div>
									</form>
									<!--单位信息结束-->
									<!--个人信息-->
									<form action="" id="InvoicePersonForm" method="post">
									<div class="fp_tab_item" style="display: none;">
										<div class="form-group clearfix">
											<label  class="col-sm-2 col-xs-5 fp_lable control-label ">
										    	发票抬头：
										    </label>
										    <div class="col-sm-5 col-xs-7 pad0">
										      	<input type="text" id="invoiceTitle" name="invoiceTitle" class="form-control" placeholder="请输入发票抬头">
										    </div>
										</div>
									</div>
									</form>
									<!--个人信息结束-->
								</div>
							</div>
							<!-- 增值税专用发票  -->
							<div class="fp_tab_box" style="display:none" id="specialInvoive">
								<div class="fp_tab_yab">
									<!--单位信息-->
									<div class="fp_tab_item special_invoice">
										<p class="line40 special_invoice_id hide"></p>
										<div class="form-group clearfix">
											<label  class="col-sm-2 col-xs-5 fp_lable control-label ">
										    	企业名称：
										    </label>
										    <div class="col-sm-5 col-xs-7 pad0">
										      	<p class="line40 special_invoice_company"></p>
										    </div>
										</div>
										<div class="form-group clearfix">
											<label  class="col-sm-2 col-xs-5 fp_lable control-label ">
										    	开票地址：
										    </label>
										    <div class="col-sm-5 col-xs-7 pad0">
										      	<p class="line40 special_invoice_address"></p>
										    </div>
										</div>
										<div class="form-group clearfix">
											<label  class="col-sm-2 col-xs-5 fp_lable control-label ">
										    	账号：
										    </label>
										    <div class="col-sm-5 col-xs-7 pad0">
										      	<p class="line40 special_invoice_account"></p>
										    </div>
										</div>
										<div class="form-group clearfix">
											<label  class="col-sm-2 col-xs-5 fp_lable control-label ">
										    	开户行：
										    </label>
										    <div class="col-sm-5 col-xs-7 pad0">
										      	<p class="line40 special_invoice_blank"></p>
										    </div>
										</div>
										<div class="form-group clearfix">
											<label  class="col-sm-2 col-xs-5 fp_lable control-label ">
										    	纳税人识别号：
										    </label>
										    <div class="col-sm-5 col-xs-7 pad0">
										      	<p class="line40 special_invoice_code"></p>
										    </div>
										</div>
								      	<p class="line40 special_invoice_isDef hide"></p>
										<div class="fp_address col-sm-offset-2 col-xs-offset-5">
											<a href="javascript:void(0)" class="chose_address" onclick="choseInvoice()">选择开票信息</a>
											<a href="javascript:void(0)" class="chose_address" onclick="showAdd()">新增开票信息</a>
											<a href="javascript:void(0)" class="chose_address" onclick="showModify()">修改开票信息</a>
										</div>
									</div>
									<!--单位信息结束-->
								</div>
							</div>
							<!--发票切换结束-->
							<div class="form-group fp_address_msg clearfix">
								<em  class="col-sm-2 col-xs-5 pad0">
							    	发票邮寄地址：
							    </em>
							    <div class="col-sm-5 col-xs-7 pad0">
									<p class="settlement_address_id hide">${defAddress.id }</p>
									<p>
							      		<span class="invoice_receive_name">${defAddress.receive }</span>
							      		<span class="invoice_receive_phone">${defAddress.phone }</span>
							      	</p>
							      	<p class="invoice_receive_address">${defAddress.provinceName }${defAddress.cityName }${defAddress.areaName }${defAddress.address }</p>
							    </div>
							</div>
							<div class="fp_address col-sm-offset-2 col-xs-offset-5">
								<a href="javascript:void(0)" class="chose_address" id="chose_invoice_address">选择地址</a>
							</div>
						</div>
					</div>
					<!--发票信息结束-->
					<!--商品信息-->
					<div class="shopping_car_title">
					<ul class="clearfix col-xs-12 pad0">
						<li class=" col-xs-3 text-center">
							<p>商品名称</p>
						</li>
						<li class=" col-xs-2 text-center">
							<p>配件编号</p>
						</li>
						<li class=" col-xs-2 text-center">
							<p>单价</p>
						</li>
						<li class=" col-xs-2 text-center">
							<p>数量</p>
						</li>
						<li class=" col-xs-2 text-center">
							<p>小计</p>
						</li>
					</ul>
					</div>
					<div class="shopping_car_list">
						<!--列表-->
						<div class="shopping_car_list_tit clearfix">
							<figure class="col-xs-12 shop_name pad0">
								<input type="hidden" value="${webStore.classify}" id="sendAreaId">
								<b class="tips">${fns:getDictLabel(webStore.type, 'store_type', '')}</b>
								<span>${webStore.cnName}</span>
							</figure>
						</div>
						<div class="shopping_car_item clearfix">
						<c:forEach items="${showShoppingCartList }" var="showShoppingCart">
							<div class=" shopping_car_item_a col-xs-12">
								<div class="col-sm-1 col-xs-2 item_img pad0">
									<div class="vel_centers">
										<a href="javascript:void(0)">
											<img src="${ctxWeb}/web/file/getFile?filePath=${showShoppingCart.goodsImage.split(';')[0]}" alt="" />
										</a>
									</div>
								</div>
								<div class="col-sm-6 col-xs-5 shop_msg_ph pad0">
									<figure class="col-sm-4  item_name pad0">
										<div class="vel_centers">
											<p>${showShoppingCart.goodsName}</p>
										</div>
									</figure>
									<figure class="col-sm-4 text-center  pad0">
										<div class="vel_centers">
											<p class="order_goods_code">${showShoppingCart.goodsCode}</p>
											<p class="order_shopping_cart_id hide">${showShoppingCart.id}</p>
										</div>
									</figure>
									<figure class="col-sm-4 text-center shop_price pad0">
										<div class="vel_centers">
											<p>¥ <span class="price_value">${showShoppingCart.goodsPrice}</span></p>
										</div>
									</figure>
								</div>
								<div class="col-sm-2 col-xs-5 ph_number">
									<figure class="col-sm-12 text-center pad0">
										<div class="vel_centers">
											<p class="item_amout">
												<a href="javascript:void(0);" class="plus js_reduce">-</a>
												<input type="number" value="${showShoppingCart.goodsNum}" class="num shop_num count" shoppingCartGoodsId="${showShoppingCart.id}">
												<a href="javascript:void(0);" class="plus js_plus">+</a>
											</p>
										</div>
									</figure>
								</div>
								<div class="col-sm-2 item_totle text-center  pad0">
									<div class="vel_centers">
										<p>¥ <span class="sum_price">0.00</span></p>
									</div>
								</div>
							</div>
							</c:forEach>
						</div>
						<!--列表结束-->
						<div class="shopping_info_box">
							<p>
								<em>商品合计：</em>
								<span>¥<span class="sum_accont"></span></span>
							</p>
							<p class="yf_wl">
								<em>运费：</em>
								<span>¥<span class="sum_yf"></span><em class="color_red advance">预收</em></span>
							</p>
							<p class="yf_kd hide">
								<em>运费：</em>
								<span class="sum_yf">到付</span>
							</p>
							<p class="pay_money">
								<em>实付金额：</em>
								<span>¥<span class="sum_accont_all"></span></span>
							</p>
						</div>
						<div class="shopping_car_price confirm_order">
							<a href="javascript:void(0)" onclick="confirmOrder()">提交订单</a>
						</div>
					</div>
					<!--商品信息结束-->
				</div>	
			</div>
		</div>
	</div>
	<!--选择地址弹框-->
	<div class="jd_tk" id="proment_chose_address" style="display: none;">
		<div class="address_Bomb">
			<h3 class="address_Bomb_title">
				选择地址
				<span class="close_page">
					<img src="${ctxWebStatic }/images/close.png" alt="" />
				</span>
			</h3>
			<div class="chose_set_box">
			
			</div>
			<div class=" shopping_car_price shopping_car_confirm">
				<a href="javascript:void(0)">确认</a>
			</div>
		</div>
	</div>
	<!--选择地址弹框结束-->
	<!--选择发票邮寄地址弹框-->
	<div class="jd_tk" id="proment_chose_invoice_address" style="display: none;">
		<div class="address_Bomb">
			<h3 class="address_Bomb_title">
				选择地址
				<span class="close_page">
					<img src="${ctxWebStatic }/images/close.png" alt="" />
				</span>
			</h3>
			<div class="chose_set_box">
			
			</div>
			<div class=" shopping_car_price shopping_car_confirm">
				<a href="javascript:void(0)">确认</a>
			</div>
		</div>
	</div>
	<!--选择开票信息弹框-->
	<div class="jd_tk" id="proment_chose_invoice" style="display: none;">
		<div class="address_Bomb">
			<h3 class="address_Bomb_title">
				选择开票信息
				<span class="close_page">
					<img src="${ctxWebStatic }/images/close.png" alt="" />
				</span>
			</h3>
			<div class="chose_set_box">
			
			</div>
			<div class=" shopping_car_price shopping_car_confirm">
				<a href="javascript:void(0)">确认</a>
			</div>
		</div>
	</div>
	<!--新增编辑地址弹框-->
	<div class="jd_tk" id="proment_new_address" style="display: none;">
		<form action="" id="addressForm" method="post">
		<input type="hidden" id="id" name="id" value="" />
		<div class="address_Bomb">
			<h3 class="address_Bomb_title">
				新增地址
				<span class="close_page">
					<img src="${ctxWebStatic }/images/close.png" alt="" />
				</span>
			</h3>
			<div class="address_Bomb_info clearfix">
				<div class="address_Bomb_left col-sm-9 clearfix">
					<input type="hidden" class="receiveId">
					<figure class="form-group clearfix">
						<label  class="col-sm-3 col-xs-5 fp_lable control-label ">
					    	收件人：
					    </label>
					    <div class="col-sm-8 col-xs-7 pad0">
					      	<input type="text" class="form-control receiveName" name="receive" placeholder="请填写收件人">
					    </div>
					</figure>
					<figure class="form-group clearfix">
						<label  class="col-sm-3 col-xs-5 fp_lable control-label ">
					    	联系方式：
					    </label>
					    <div class="col-sm-8 col-xs-7 pad0">
					      	<input type="text" class="form-control receivePhone" name="phone" placeholder="请填写联系方式">
					    </div>
					</figure>
					<figure class="form-group clearfix">
						<label  class="col-sm-3 col-xs-5 fp_lable control-label ">
					    	所在地区：
					    </label>
					    <div class="col-sm-8 col-xs-7 pad0">
					      	<div class="tk_selcet"><!-- container -->									  	
								<select class="hy col-xs-12 col-sm-3 provinceSelect" name="province">
									<option value="">省</option>
								</select>
								<select class="hy col-xs-12 col-sm-3 citySelect" name="city">
									<option value="">市</option>
								</select>
								<select class="hy col-xs-12 col-sm-3 areaSelect" name="area">
									<option value="">区</option>
								</select>
							</div>
					    </div>
					</figure>
					<figure class="form-group clearfix">
						<label  class="col-sm-3 col-xs-5 fp_lable control-label ">
					    	详细地址：
					    </label>
					    <div class="col-sm-8 col-xs-7 pad0">
					      	<input type="text" class="form-control receiveAddress" name="address" placeholder="请填写详细地址">
					    </div>
					</figure>
				</div>
				<div class="col-sm-3 default_left">
					<div class="default_box">
						<i class="search_chose"></i>
						<span>设为默认地址</span>
					</div>
					<div class='numRadio' style="display: none;">
						<input type='checkbox' name='isDef' value='设为默认地址' />
					</div>
				</div>
			</div>
			<div class=" shopping_car_price  proment_chose_address_save">
				<a href="javascript:void(0)">确认</a>
			</div>
		</div>
		</form>
	</div>
	<!--新增修改地址弹框结束-->
	<!--发票弹框-->
	<div class="jd_tk" id="proment_new_fptitket" style="display: none;">
		<form action="${ctxWeb}/webInvoice/save" id="updateForm" method="post">
			<input type="hidden" id="invoiceId" name="id" value="" />
			<div class="address_Bomb">
				<h3 class="address_Bomb_title">
					发票信息 <span class="close_page"> <img
						src="${ctxWebStatic}/images/close.png" alt="" />
					</span>
				</h3>
				<div class="address_Bomb_info clearfix">
					<div class="address_Bomb_left col-sm-9 clearfix">
						<figure class="form-group clearfix">
							<label class="col-sm-3 col-xs-5 fp_lable control-label ">
								企业名称： </label>
							<div class="col-sm-8 col-xs-7 pad0">
								<input type="text" class="form-control" id="company"
									name="company" placeholder="请输入企业名称">
							</div>
						</figure>

						<figure class="form-group clearfix">
							<label class="col-sm-3 col-xs-5 fp_lable control-label ">
								开票地址： </label>
							<div class="col-sm-8 col-xs-7 pad0">
								<div data-toggle="distpicker" class="tk_selcet">
									<!-- container -->
									<input type="text" class="form-control" id="address"
										name="address" placeholder="请输入开票地址">
								</div>
							</div>
						</figure>
						<figure class="form-group clearfix">
							<label class="col-sm-3 col-xs-5 fp_lable control-label ">
								账户： </label>
							<div class="col-sm-8 col-xs-7 pad0">
								<input type="text" class="form-control" id="account"
									name="account" placeholder="请输入账户">
							</div>
						</figure>
						<figure class="form-group clearfix">
							<label class="col-sm-3 col-xs-5 fp_lable control-label ">
								开户银行： </label>
							<div class="col-sm-8 col-xs-7 pad0">
								<input type="text" class="form-control" id="blank" name="blank"
									placeholder="请输入开户银行">
							</div>
						</figure>
						<figure class="form-group clearfix">
							<label class="col-sm-3 col-xs-5 fp_lable control-label ">
								纳税人识别号： </label>
							<div class="col-sm-8 col-xs-7 pad0">
								<input type="text" class="form-control" id="dutyCode"
									name="dutyCode" placeholder="请输入纳税热识别号">
							</div>
						</figure>
					</div>
					<div class="col-sm-3 default_left">
						<div class="default_box">
							<i class="search_chose"></i> <span>设为默认发票信息</span>
						</div>
						<div class='numRadio' style="display: none;">
							<input type='checkbox' name='isDef' id="isDef" value='1' />
						</div>
					</div>
				</div>
				<div class=" shopping_car_price shopping_car_confirm">
					<a href="javascript:void(0)" onclick="sub()">确认</a>
				</div>
			</div>
		</form>
	</div>
	<!--发票弹框结束-->
	<form action="${ctxWeb}/shoppingCart/commonConfirmOrder" id="commonConfirmOrderForm" method="post">
		<!-- 订单   -->
		<input name="goodsCodes" id="goodsCodes" type="hidden">
		<input name="shoppingCartIds" id="shoppingCartIds" type="hidden">
		<input name="transportType" value="1" id="transportType" type="hidden">
		<input name="isFree" id="isSatisfyFreeInput" type="hidden">
		<input name="sendAreaId" id="sendAreaIdInput" type="hidden">
		<input name="receiveAreaId" id="receiveAreaIdInput" type="hidden">
		<input name="receiveName" id="receiveName" type="hidden">
		<input name="receivePhone" id="receivePhone" type="hidden">
		<input name="receiveAddress" id="receiveAddress" type="hidden">
		<input name="isInvoice" id="isInvoice" value="0" type="hidden">
		<input name="buyStoreName" value="${webStore.cnName }" type="hidden">
		<input name="buyStoreCode" value="${webStore.code }" type="hidden">
		<!-- 发票   -->
		<input name="invoiceReceiveName" id="invoiceReceiveName" type="hidden">
		<input name="invoiceReceivePhone" id="invoiceReceivePhone" type="hidden">
		<input name="invoiceReceiveAddress" id="invoiceReceiveAddress" type="hidden">
		<input name="invoiceType" id="invoiceTypeInput" type="hidden">
		<input name="account" id="invoice_account" type="hidden">
		<input name="blank" id="invoice_blank" type="hidden">
		<input name="dutyCode" id="invoice_dutyCode" type="hidden">
		<input name="company" id="invoice_company" type="hidden">
		<input name="address" id="invoice_address" type="hidden">
		<input name="invoiceTitle" id="invoiceTitleInput" type="hidden">
	</form>
	</body>
</html>
